﻿using System;
using System.Web.UI.WebControls;
using Ue.Framework.Web.WebControls;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain;
using Ue.Qcdz.Domain.FriendLink;
namespace Ue.Qcdz.UI.Controls.FriendLink
{
    public class FileLinkView : SkinnedGridView
    {
        private string skinFileName = "~/Admin/Themes/Skins/FriendLinks/FrienLinkView.ascx";
        #region Overrides of SkinnedControl
        private FriendLinkRadio friendLinkRadio;
        public string SearchKey { get; set; }
        public string Status { get; set; }

        public FileLinkView()
        {
            SearchKey = SiteContext.GetSiteContext().SearchKey;
            Status = SiteContext.GetSiteContext().Status;
        }
      
        protected override string GetSkinFileName()
        {
            return skinFileName;
        }
        protected override void InitializeSkin(System.Web.UI.Control skin)
        {

            friendLinkRadio = skin.FindControl<FriendLinkRadio>("friendLinkRadio");
            base.InitializeSkin(skin);
        }
        #endregion

        #region Overrides of SkinnedGridView

        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            IDataResult<FriendLinks> dataResult = FriendLinksService.GetFriendLinks(this);
            Repeater repeater = sender as Repeater;
            repeater.DataSource = dataResult.DataObjects;
            repeater.DataBind();
            this.RecordCount = dataResult.RecordCount;
        }

        #endregion
    }
}
